<template>
  <el-menu
    class="banner-container"
    mode="horizontal"
    background-color="#285fce"
    active-text-color="#ffd04b"
    text-color="#fff"
    :style="{
      paddingLeft: p + 'vw',
      paddingRight: p + 'vw',
    }"
  >
    <div class="sub-container">
      <div class="title">
        <img :src="img" alt="" />
        <span>国家工业互联网标识解析安全应急行业公共服务平台</span>
      </div>

      <div class="login">
        <div class="input">
          <input type="text" placeholder="请输入内容" />
          <img :src="icon" alt="" />
        </div>
        <button @click="handleLoginClick">登录</button>
        <span class="line">|</span>
        <button @click="handleRegClick">注册</button>
      </div>
    </div>
  </el-menu>
</template>

<script>
import img from "@/assets/data/exports/logo@1x.png";
import icon from "@/assets/data/exports/searchBox@3x.png";
export default {
  props: {
    p: {
      default: 6,
    },
  },
  data() {
    return {
      img,
      icon,
    };
  },
  methods: {
    handleLoginClick() {
      location = "http://182.151.11.69:30000/#/login"
    },
    handleRegClick() {
      location.hash = "/reg";
    },
  },
};
</script>

<style lang="scss" scoped>
.banner-container {
  height: 70px;
  margin: 0;
  padding: 15px;
  color: white;
  font-weight: bold;
  font-size: 25px;
  border-bottom: 1px #aaa solid;
}
.sub-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
}

.title {
  overflow: hidden;
  img {
    width: 1.6em;
    vertical-align: -5px;
    margin-right: 0.5em;
  }
}

.login {
  flex: 0 0 auto;
  padding-left: 20px;
  position: relative;

  .input {
    display: inline-block;
    position: relative;
    margin-right: 20px;
  }

  img {
    position: absolute;
    width: 32px;
    right: 5px;
    top: 5px;
    cursor: pointer;
  }

  $font-size: 14px;
  input {
    $font-size: 15px;
    padding: 7px 12px;
    background: #4878d3;
    border: none;
    color: white;
    border-radius: 3px;
    height: 20px;
    width: 160px;
  }
  input::placeholder {
    color: #eee;
    font-size: 13px;
  }
  button {
    background: inherit;
    border: none;
    color: white;
    cursor: pointer;
    font-size: $font-size;
  }
  .line {
    font-size: 20px;
    font-weight: normal;
    vertical-align: -2px;
  }
}
</style>
